package com.esm.sm800.database.dbmodel;


import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

//员工表
@Entity
public class Member {

    @Id(autoincrement = true)
    private Long id;

    private String account = "";
    private String password = "";

    private String name = "";

    private String remark = "";//组号

    private String zhiwen = ""; //指纹ID

    private String nfc = ""; //nfc HEX

    private int status = 0; //0-正常 1-禁用

    private int type = 0; //0-总管理员 1-部门管理员 2-领取人员

    private int borrow = 5; //每日可借针次数

    private int receive = 5; //每日可领针次数

    private String creat_time = "";

    private String update_time = "";

    private String facefeatures = "";//人脸识别的特征-字符串；逗号分割，如  “12.1,2.12,3.11”；  float[] features

    public void setff(float[] features) {
        if (features == null) {
            return;
        }
        this.facefeatures = "";
        for (int i = 0; i < features.length; i++) {
            float feature = features[i];
            if (i == features.length - 1) {
                this.facefeatures += feature + "";
            } else {
                this.facefeatures += feature + ",";
            }
        }
    }

    public float[] getff() {
        if (this.facefeatures == null || this.facefeatures.length() < 1) {
            return null;
        }
        String[] ffarray = this.facefeatures.split(",");
        float[] floatArray = new float[ffarray.length];
        try {
            int i = 0;
            for (String part : ffarray) {
                float floatValue = Float.parseFloat(part);
                floatArray[i] = floatValue;
                i++;
            }
        } catch (NumberFormatException e) {
            // 如果字符串不能被解析为float，则捕获异常并处理
            e.printStackTrace();
            return null;
        }
        return floatArray;
    }

    @Generated(hash = 22450580)
    public Member(Long id, String account, String password, String name,
            String remark, String zhiwen, String nfc, int status, int type,
            int borrow, int receive, String creat_time, String update_time,
            String facefeatures) {
        this.id = id;
        this.account = account;
        this.password = password;
        this.name = name;
        this.remark = remark;
        this.zhiwen = zhiwen;
        this.nfc = nfc;
        this.status = status;
        this.type = type;
        this.borrow = borrow;
        this.receive = receive;
        this.creat_time = creat_time;
        this.update_time = update_time;
        this.facefeatures = facefeatures;
    }

    @Generated(hash = 367284327)
    public Member() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAccount() {
        return this.account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getZhiwen() {
        return this.zhiwen;
    }

    public void setZhiwen(String zhiwen) {
        this.zhiwen = zhiwen;
    }

    public String getNfc() {
        return this.nfc;
    }

    public void setNfc(String nfc) {
        this.nfc = nfc;
    }

    public int getStatus() {
        return this.status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getType() {
        return this.type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getBorrow() {
        return this.borrow;
    }

    public void setBorrow(int borrow) {
        this.borrow = borrow;
    }

    public int getReceive() {
        return this.receive;
    }

    public void setReceive(int receive) {
        this.receive = receive;
    }

    public String getCreat_time() {
        return this.creat_time;
    }

    public void setCreat_time(String creat_time) {
        this.creat_time = creat_time;
    }

    public String getUpdate_time() {
        return this.update_time;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }

    public String getFacefeatures() {
        return this.facefeatures;
    }

    public void setFacefeatures(String facefeatures) {
        this.facefeatures = facefeatures;
    }

   
}
